# Contributor: Michael Pirogov <vbnet.ru@gmail.com>
# Maintainer: Michael Pirogov <vbnet.ru@gmail.com>
pkgname="restart-services"
pkgver="0.14.4"
pkgrel=0
pkgdesc="Tool to manage OpenRC services that need to be restarted"
url="https://dev.gentoo.org/~mschiff/restart-services/"
arch="noarch"
license="GPL-3.0-or-later"
depends="bash py3-lib_users openrc ncurses"
options="!check" # single bash script w/o tests
subpackages="$pkgname-doc"
source="https://dev.gentoo.org/~mschiff/src/restart-services/restart-services-$pkgver.tgz
	alpine.patch"

package() {
	install -D -m 0755 $pkgname "$pkgdir"/usr/sbin/$pkgname
	install -D -p -m 644 $pkgname.1 \
		"$pkgdir"/usr/share/man/man1/$pkgname.1
	install -D -m644 CHANGES \
		"$pkgdir"/usr/share/doc/$pkgname/CHANGES
	install -D -m644 README \
		"$pkgdir"/usr/share/doc/$pkgname/README
	sed -i "s/^#include/include/" $pkgname.conf
	install -D -m600 $pkgname.conf "$pkgdir"/etc/$pkgname.conf
	mkdir -p "$pkgdir"/etc/$pkgname.d
	cat>"$pkgdir"/etc/$pkgname.d/00-local.conf<<-EOF
	# You may put your local changes here or in any other *.conf file
	# in this directory so you can leave /etc/restart-services.conf as is.
	# Example:
	# *extend* SV_ALWAYS to match 'myservice'
	# SV_ALWAYS+=( myservice )
	EOF


}

sha512sums="89bd5edf5175694b3438788759f9b747251431ba700ad199f43b8fa551faa23411f33688e1aa6b04ae6524e737c4073926b989fa1422ddfca94514f9afd8de66  restart-services-0.14.4.tgz
bb2ab053de7de951a8038b21c67b7349ccce227cc1ffdd11a4056b32e379f1550c595a10729dc8b34adbddf697dcf281e37d399e22144d239e6463a96e1c45fd  alpine.patch"
